package com.jkdroid.maya.log;

import android.content.Context;

import org.json.JSONObject;


/**
 * 日志功能API
 * @author guanzhihao
 * @date   2015年11月2日
 *
 */
public class EventLog{

	private static final int DEFAULT_MAX_RECORD_SIZE = 1000;//最大日志存储容量
	private static final int DEFAULT_AUTO_NUM = 20;//自动发送的上阀门
	private static ConcurrentEventLog<JSONObject> mConcurrentEventLog;

	public static void init(AbstractEventLogStrategy strategy){
		mConcurrentEventLog = new ConcurrentEventLog<>(strategy);
	}

	// EventLog.record(mContext, "login", "login_show", "");
	public static void record(Context context, String eventId, String eventName, String eventValue) {
		get().record(context, eventId, eventName, eventValue);
	}

	public static void send(Context context) {
		get().send(context);
	}

	public static void clear(Context context) {
		get().clear(context);
	}
	
	private static ConcurrentEventLog<JSONObject> get(){
		return mConcurrentEventLog;
	}
	
}
